﻿using System;
using System.Collections.Generic;
using System.Web;

namespace web
{
    public class adminBase : System.Web.UI.Page
    {
        public Domain.Administrators admin;
        public adminBase()
        {

        }
        protected override void OnPreInit(EventArgs e)
        {
            if (System.Web.HttpContext.Current.Session["admin"] != null)
            {
                admin = (Domain.Administrators)System.Web.HttpContext.Current.Session["admin"];
            }
            else
            {
                Common.Message.alertAndRedirect("此功能登陆后才可以使用", "adminlogin.aspx", true);
                Response.End();
            }
            base.OnPreInit(e);
        }
        /// <summary>
        /// 管理员角色
        /// </summary>
        public int role
        {
            get { return Common.Utils.ObjectToInt(admin.roles, 0); }
        }
    }
}
